package com.example.emos.wx.controller;


import com.example.emos.wx.common.ResultVO;
import com.example.emos.wx.entity.TbDept;
import com.example.emos.wx.service.TbDeptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author MC鹏浩
 * @since 2021-03-02
 */
@RestController
@RequestMapping("/tb-dept")
@Api("测试Web接口")
public class TbDeptController {

    @Autowired
    private TbDeptService tbDeptService;

    @GetMapping
    @ApiOperation("查询所有部门")
    public ResultVO<List<TbDept>> queryList(){
        List<TbDept> tbDepts = tbDeptService.queryList();
        return ResultVO.success(tbDepts);
    }

}

